{## -*- codeing = utf-8 -*-#}
{## @Author : Alan_Sheng#}
{## @Software : PyCharm#}

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Alan</title>
    {#    <meta http-equiv="refresh" content="100 url='/login'">#}
    <link rel="stylesheet" href="{{ url_for('static', filename='layui/css/layui.css') }}">
    <script type="text/javascript" src="jqure/jquery-3.6.0.min.js"></script>
    <script type="text/javascript">
        function loginForAjax() {
            uname = $("l_uname").val();
            if (uname.length == 0){
                layer.msg("uname can not null")
                return
            }
            upwd=$("l_upwd").val();
            if(upwd.lenght==0){
                layer.msg("upwd can not null")
                return
            }
            if(upwd.lenght<6){
                layer.msg("upwd is not less 6")
                return
            }
            $.ajax({
                url:'/login',
                data:$("#f2").serialize(),
                method: "post",
                success:function (result){

                }
            })



        }

        function registerForAjax() {
            $.ajax({
                url: "register",
                method: "post",
                data: $("#f-register").serialize(),
                success: function (result) {
                    if (result == '1') {
                        alert("success")
                    } else {
                        alert("default")
                    }
                },
                error: function (e) {
                    alert("conn error!")
                }
            });
        }
    </script>
</head>
<body>
{#<form name="f1" action="/login" method="post">#}
{#    <input type="'text" name="'uname" placeholder="请输入一个用户名：">#}
{#    <a href="javascript:f1.submit()">submit</a>#}
{#</form>#}
{#<button type="button" class="layui-btn layui-btn-danger">Test</button>#}
<center>
    {#    <img src="{{ url_for('static', filename='image/bg_jx.jpeg') }}" style="height: 129px; width: 195px">#}
    <div style="width: 40%">
        <div class="layui-tab layui-tab-brief">
            <ul class="layui-tab-title">
                <li>登陆</li>
                <li>注册</li>
            </ul>

            <div class="layui-tab-content">
                <div class="layui-tab-item">
                    <fieldset class="layui-elem-field">
                        <legend>登陆页面</legend>
                    </fieldset>
                    <form action="#" method="post" id="f-login" name="f-login" class="layui-form">
                        <div class="layui-form-item">
                            <label class="layui-form-label">User-name:</label>
                            <div class="layui-input-block">
                                <input type="text" id="uname-login" name="uname-login" class="layui-input"
                                       placeholder="请输入用户名">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">User-pwd:</label>
                            <div class="layui-input-block">
                                <input type="text" id="upwd-login" name="upwd-login" class="layui-input"
                                       placeholder="请输入密码">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">Cu-pwd:</label>
                            <div class="layui-input-block">
                                <input id="cupwd-login" name="cupwd-login" class="layui-input" placeholder="请输入确认密码">
                            </div>
                        </div>
                        <div class="layui-form-item" align="center">
                            <a href="" class="layui-btn"><span class="layui-icon layui-icon-user"></span>登陆</a>
                            <a href="" class="layui-btn layui-btn-warm"><span
                                    class="layui-icon layui-icon-fonts-clear"></span>注册</a>
                        </div>
                    </form>
                </div>


                <div class="layui-tab-item">
                    <fieldset class="layui-elem-field">
                        <legend>注册页面</legend>
                    </fieldset>
                    <form action="#" method="post" id="f-register" name="f-register" class="layui-form">
                        <div class="layui-form-item" align="center">
                            <label class="layui-form-label">User-name:</label>
                            <div class="layui-input-block">
                                <input type="text" id="uname-register" name="uname-register" class="layui-input"
                                       placeholder="请输入注册用户名">
                            </div>
                        </div>
                        <div class="layui-form-item" align="center">
                            <label class="layui-form-label">User-pwd:</label>
                            <div class="layui-input-block">
                                <input type="password" id="upwd-register" name="upwd-register" class="layui-input"
                                       placeholder="请输入注册密码">
                            </div>
                        </div>

                        <div class="layui-form-item" align="center">
                            <label class="layui-form-label">Cu-pwd:</label>
                            <div class="layui-input-block">
                                <input type="password" id="cupwd-register" name="cupwd-register" class="layui-input"
                                       placeholder="请输入确认密码">
                            </div>
                        </div>
                        <div class="layui-form-item" align="center">
                            <a href="" class="layui-btn"><span class="layui-icon layui-icon-user"></span>注册</a>
                            <a href="" class="layui-btn layui-btn-warm"><span
                                    class="layui-icon layui-icon-fonts-clear"></span>重置</a>
                        </div>

                    </form>

                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="{{ url_for('static', filename='layui/layui.js') }}" charset="utf-8"></script>
</center>
</body>
</html>